﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VideoNetApplication.Common;
using VideoNetApplication.Common.Helper;
using VideoNetApplication.Common.Service;

namespace VideoNetApplication
{
    public partial class ViewTeacherDetail : BasePage
    {
        private int nid = 0;
        public V_teacher vTeacher;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["nid"] != null && StringUtils.IsNumeric(Request["nid"]))
            {
                nid = Convert.ToInt32(Request["nid"]);
            }
            GetNewsDetail();
        }

        public void GetNewsDetail()
        {
            var vTeacherService = new TeacherService();
              vTeacher = vTeacherService.GetTeacherByID(nid,SchoolId);
              if (vTeacher != null)
              {
                  ltrName.Text = vTeacher.VT_realname;
                  ltrImg.Text = string.IsNullOrEmpty(vTeacher.VT_Image)
                                    ? "<img src='Images/nopic.gif'/>"
                                    : "<img src='" +PictureServerName+ vTeacher.VT_Image + "'/>";
                  ltrDesc.Text = StringUtils.getLimitLengthString(vTeacher.VT_desc, 150, "");
                  ltrEmail.Text = vTeacher.VT_email;
                  ltrContent.Text = vTeacher.VT_desc;
              }


        }
    }
}
